//
//  TestRecordTableViewCell.swift
//  Auscultation
//
//  Created by 张文博 on 2021/4/13.
//

import UIKit

class TestRecordTableViewCell: UITableViewCell {
    @IBOutlet weak var testTimeL: UILabel!
    
    @IBOutlet weak var resultL: UILabel!
    @IBOutlet weak var totalScoreL: UILabel!
    @IBOutlet weak var testMakeTimeL: UILabel!
    @IBOutlet weak var testScoreL: UILabel!
    @IBOutlet weak var backView: UIView!
    var model: TestRecordModel = TestRecordModel(){
        didSet{
            self.testTimeL.text = model.examBeginTimeString
            self.totalScoreL.text = model.totalScore
            let score = "成绩 " + model.score
            self.testScoreL.attributedText = changeFontColor(totalString: score, subString: "成绩 ", font: UIFont.systemFont(ofSize: 15), textColor: UIColor(hexString: "#505050")!)
            self.testMakeTimeL.text = model.testTimeString
            if model.status == "1" {
                self.resultL.text = "通过"
                self.resultL.textColor = UIColor(hexString: "#91D101")

            }else{
                self.resultL.text = "未通过"
                self.resultL.textColor = UIColor(hexString: "#ce1212")

            }
        }
    }
    

    override func awakeFromNib() {
        super.awakeFromNib()
        self.contentView.backgroundColor = UIColor(hexString: "#f3f3f3")
        backView.layer.cornerRadius = 5
//        backView.layer.shadowColor = UIColor(red: 0, green: 0, blue: 0, alpha: 0.15).cgColor
//        backView.layer.shadowOffset = CGSize(width: 0, height: 1.5)
//        backView.layer.shadowOpacity = 1
//        backView.layer.shadowRadius = 4
    }

    override func setSelected(_ selected: Bool, animated: Bool) {
        super.setSelected(selected, animated: animated)

        // Configure the view for the selected state
    }
    
}
